/*
 * @(#)IRPCClient.java
 * Date 2014-01-20
 * Version 1.0
 * Author Jim Horner
 * Copyright (c)2012
 */

package com.chrisuyehara.vista.rpc.client;

import java.io.IOException;

import com.chrisuyehara.vista.rpc.exceptions.ConnectException;
import com.chrisuyehara.vista.rpc.exceptions.LoginException;

import com.chrisuyehara.vista.rpc.procedures.IRemoteProcedure;


/**
 * Interface description
 *
 *
 * @version        v1.0, 2014-01-20
 * @author         Jim Horner    
 */
public interface IRPCClient {

    /**
     * Method description
     *
     *
     * @param remoteProcedure
     *
     * @throws IOException
     */
    void call(IRemoteProcedure remoteProcedure) throws IOException;

    /**
     * @throws ConnectException
     * @throws IOException
     */
    void connect() throws ConnectException, IOException;

    /**
     * Change the broker context to the supplied context. Numerous context's have been built in; they are
     * available as constant strings in the class CreateContext.
     *
     * @param context the context to change to
     * @throws IOException when the rpc client is unable to communicate with the rpc broker.
     */
    void context(String context) throws IOException;

    /**
     * Logout and disconnect the RPC socket
     */
    void disconnect();

    /**
     * Method description
     *
     *
     * @return
     */
    String getContext();

    /**
     * @return
     */
    boolean isConnected();

    /**
     * Method description
     *
     *
     * @return
     */
    boolean isManagedRPCClient();

    /**
     * @param accessCode unencrypted form of the access code
     * @param verifyCode unencrypted form of the verify code
     * @throws LoginException
     * @throws IOException
     */
    void login(String accessCode, String verifyCode) throws LoginException, IOException;

    /**
     * Logout and disconnect the RPC socket; equivalent call to disconnect();
     */
    void logout();
}
